/*
 * @Author       : wang chao
 * @Date         : 2023-01-18 14:41:46
 * @LastEditors  : wang chao
 * @LastEditTime : 2023-01-18 14:53:31
 * @FilePath     : lb_virtualIO.h
 * @Description  : 
 * Copyright 2023 BingShan, All Rights Reserved. 
 */
#ifndef _VIO_H_
#define _VIO_H_

#include "stdio.h"
#include "string.h"
#include "stdint.h"
#include "lite_mb.h"

/*
 * coils
 */
int lbo_read_hold_coils(uint16_t addr, uint16_t num, uint8_t *buffer);
int lbo_read_input_coils(uint16_t addr, uint16_t num, uint8_t *buffer);

int lbo_write_hold_coils(uint16_t addr, uint16_t num, uint8_t *buffer);

int lbo_lowlevel_update_hold_coils(uint16_t addr, uint16_t num, uint8_t *buffer);

int lbo_lowlevel_update_input_coils(uint16_t addr, uint16_t num, uint8_t *buffer);

/*
 * regs
 */
int lbo_read_hold_regs(uint16_t addr, uint16_t num, uint16_t *buffer);
int lbo_read_input_regs(uint16_t addr, uint16_t num, uint16_t *buffer);

int lbo_write_hold_regs(uint16_t addr, uint16_t num, uint16_t *buffer);

int lbo_lowlevel_update_hold_regs(uint16_t addr, uint16_t num, uint16_t *buffer);

int lbo_lowlevel_update_input_regs(uint16_t addr, uint16_t num, uint16_t *buffer);

#endif
